//P1480 A/B Problem
#include <iostream>
#include <string.h>
#include <cmath>
using namespace std;
int c[5010];
long long tmp;
char A[5010];
long long int b;

int main(){
	cin >> A >> b;
	tmp = 0;
	if(A[0]=='0'){
		cout << 0;
		return 0;
	}
	int point=0,k=0;
//	cout << b << endl;
	for(int i=0;i<strlen(A);i++){
		tmp=tmp*10 + (A[i]-'0');
//		cout << tmp << endl;
		if(tmp==0){
			c[point]=0;
			point++;
			tmp=tmp*10;
		}
		else if(tmp < b){
			if(k) point++;
		}else{
			k=1;
			c[point]=tmp/b;
			tmp = tmp - (tmp/b) * b;
			point++;
		}
	}
	for(int i=0;i<point;i++){
		cout << c[i] ;
	}
}
